<template>
	<view class="content">
		<text class="success-icon yticon icon-xuanzhong2"></text>
		<text class="tit">支付成功{{money}}元</text>
		<view class="btn-group">
			<navigator url="/pages/quickpay/quickpay" open-type="redirect" class="mix-btn hollow">继续付款</navigator>
		</view>
		<!-- #ifdef MP-WEIXIN -->
		<view v-if="wmz_ad_open" style="width: 96%;margin: 40rpx auto;">
			<template v-if="adversing_type">
				<ad :unit-id="wmz_ad_unit" ad-intervals="30"></ad>
			</template>
			<template v-else>
				<wmz-ad-banner :ad_unit="wmz_ad_unit" />
			</template>
		</view>
		<!-- #endif -->
	</view>
</template>

<script>
	import {
		mapState,
		mapMutations
	} from 'vuex'

	let _this

	export default {
		data() {
			return {
				money: "",
				wmz_ad_open: false,
				wmz_ad_unit: ""
			}
		},
		async onLoad(e) {
			_this = this
			this.money = e.money
			// #ifdef MP-WEIXIN
			this.wxaAdverConfigGet()
			// #endif
		},
		methods: {
			wxaAdverConfigGet() {
				this.$func.wmz_adver.call('wmzAdverCatering/adverShopConfigGet', {
					appId: uni.getStorageSync('wmzmall_user_app_id'),
					shopId: uni.getStorageSync('wmzmall_user_shop_id'),
					adProvider: "wx"
				}).then(res => {
					if (res.code === 200) {
						_this.wmz_ad_open = true
						_this.wmz_ad_unit = res.data.page_pay_before.adver_id
						_this.adversing_type = res.data.page_pay_before.adversing_type
					}
				})
			},
			goBack() {
				uni.navigateBack()
			}
		}
	}
</script>

<style lang='scss'>
	.content {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}

	.success-icon {
		font-size: 160upx;
		color: #fa436a;
		margin-top: 100upx;
	}

	.tit {
		font-size: 38upx;
		color: #303133;
	}

	.btn-group {
		padding: 44rpx 0 50rpx 0;
	}

	.mix-btn {
		margin-top: 30upx;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 600upx;
		height: 80upx;
		font-size: 32rpx;
		color: #fff;
		background-color:  #F8F8F8;
		border-radius: 10upx;

		&.hollow {
			background: #fff;
			color: #303133;
			border: 1px solid #ccc;
		}
	}

	.ad {
		width: 96%;
		margin: 10rpx auto;
	}
</style>
